package com.yike.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yike.order.entity.Order;
import com.yike.order.param.OrderPageParam;
import com.yike.order.param.PlatformOrderPageParam;
import com.yike.order.param.ShopOrderPageParam;
import com.yike.order.vo.OrderListVo;
import com.yike.order.vo.OrderVo;
import com.yike.order.vo.PlatformOrderInfoVo;
import com.yike.order.vo.PlatformOrderVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 订单表 Mapper 接口
 *
 * @author yike
 * @since 2024-07-18
 */
@Mapper
public interface OrderMapper extends BaseMapper<Order> {

    IPage<OrderListVo> getUserOrderList(@Param("page") Page page, @Param("userId") Long userId,
                                        @Param("param") OrderPageParam param);

    IPage<OrderListVo> getShopOrderList(@Param("page") Page page,
                                        @Param("param") ShopOrderPageParam param);

    BigDecimal getShopRevenue(@Param("shopId") Long shopId, @Param("certainDate") String certainDate,
                              @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    BigDecimal getShopGarrisonRevenue(@Param("shopId") Long shopId, @Param("certainDate") String certainDate,
                                      @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    Integer getShopOrderNumber(@Param("shopId") Long shopId, @Param("certainDate") String certainDate,
                               @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    Integer getShopRefundNumber(@Param("shopId") Long shopId, @Param("certainDate") String certainDate,
                                @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    IPage<PlatformOrderVo> getOrderList(@Param("page") Page page,
                                        @Param("param") PlatformOrderPageParam param);

    PlatformOrderInfoVo getPlatformOrderInfoVo(@Param("orderNo") String orderNo);


}
